Summary(ru): Настройки рабочего окружения дистрибутивов МОС
Summary:	XDG desktop settings for MOS distros
Name:		mos-xdg
License:	GPL-3.0
Group:		Graphical desktop/Other
Version:	2.14
Release:	2
Url:		https://hub.mos.ru/mos/pkgs/mos-xdg
Vendor:		MOS
Source10:	COPYING
Source11:	dolphinrc
Source12:	dolphinui.rc
Source13:	kcminputrc
Source14:	kcm-about-distrorc
Source15:	kdeglobals
Source16:	kxkbrc
Source17:	mimeapps.list
Source18:	mos-xdg-env
Source19:	profile.sh
Source20:	systemd.sh
Source21:	test.sh
Source22:	kwalletrc
Source23:	spectaclerc
Source24:	plasmarc
Source25:	kiorc
BuildArch:	noarch

%description
XDG desktop settings for MOS distros
%description -l ru_RU.UTF-8
Настройки рабочего окружения дистрибутивов МОС

#--------------------------------------------------------------

%package core
Summary: Engine to set distribution-specific desktop settings
Summary(ru): Движок установки дистрибутиво-специфичных настроек рабочего стола
Group: Graphical desktop/Other
Requires: sed

%description core
Engine to set distribution-specific desktop settings.
Sets environmental variables $XDG_CONFIG_DIRS and $XDG_DATA_DIRS,
adding /etc/xdg/mos and /usr/share/mos into them.
Can be used separately from MOS.

%description -l ru_RU.UTF-8 core
Движок установки дистрибутиво-специфичных настроек рабочего стола.
Устонавливает переменные окружения $XDG_CONFIG_DIRS и $XDG_DATA_DIRS,
добавляя в них /etc/xdg/mos и /usr/share/mos.
Может быть использован вне МОС.

%files core
%license COPYING
%dir /etc/xdg/mos
%dir /etc/xdg/mos/autostart
%dir /usr/share/mos
%_bindir/mos-xdg-env
%_systemd_user_env_generator_dir/10-mos-xdg.sh
/etc/profile.d/10-mos-xdg.sh

#--------------------------------------------------------------

# alternatives between plasma5-classic, plasma5-foo etc. can be added later

%package plasma5-classic
Summary: KDE 5 desktop settings for classic variant of MOS
Summary(ru): Настройки KDE 5 для классического варианта МОС
Group: Graphical desktop/KDE
Requires: %{name}-core = %{EVRD}
# mos-icons are currently not used
#Requires: mos-icons-theme-classic
Requires: plasma5-rosa-icons
Requires: plasma5-rosa-icons-dark
Requires: plasma5-color-scheme-mos
Requires: plasma5-look-and-feel-mos

%description plasma5-classic
KDE 5 desktop settings for classic variant of MOS

%description -l ru_RU.UTF-8 plasma5-classic
Настройки KDE 5 для классического варианта МОС

%files plasma5-classic
%license COPYING
/etc/xdg/mos/spectaclerc
/etc/xdg/mos/dolphinrc
/etc/xdg/mos/kcminputrc
/etc/xdg/mos/kcm-about-distrorc
/etc/xdg/mos/kdeglobals
/etc/xdg/mos/kxkbrc
/etc/xdg/mos/mimeapps.list
/etc/xdg/mos/kwalletrc
/etc/xdg/mos/plasmarc
/etc/xdg/mos/kiorc
%dir /usr/share/mos/kxmlgui5
%dir /usr/share/mos/kxmlgui5/dolphin
/usr/share/mos/kxmlgui5/dolphin/dolphinui.rc

#--------------------------------------------------------------

%prep
%setup -T -c
cp %sources .

%install

mkdir -p %buildroot%_bindir
mkdir -p %buildroot/etc/profile.d
mkdir -p %buildroot%_systemd_user_env_generator_dir
install -m0755 mos-xdg-env %buildroot%_bindir/mos-xdg-env
# for console
install -m0755 profile.sh %buildroot/etc/profile.d/10-mos-xdg.sh
# for dbus services
install -m0755 systemd.sh %buildroot%_systemd_user_env_generator_dir/10-mos-xdg.sh

mkdir -p %buildroot/etc/xdg/mos/autostart
cp \
	spectaclerc \
	dolphinrc \
	kcm-about-distrorc \
	kcminputrc \
	kdeglobals \
	kxkbrc \
	mimeapps.list \
	kwalletrc \
	plasmarc \
	kiorc \
	%buildroot/etc/xdg/mos
mkdir -p %buildroot/usr/share/mos/kxmlgui5/dolphin
cp dolphinui.rc %buildroot/usr/share/mos/kxmlgui5/dolphin

%check
# 755 mode is lost when building SRPM
chmod +x test.sh
./test.sh
